/*
 * twoLvHTAnalyser.h
 *
 *  Created on: Dec 6, 2012
 *      Author: hxin
 */

#ifndef TWOLVHTANALYSER_H_
#define TWOLVHTANALYSER_H_

#include "common.h"
#include "refAnalyser.h"
#include "refHash.h"

using namespace std;

class twoLvHTAnalyser: public refHash {
public:
	//Constructor, distructor
	twoLvHTAnalyser();
	twoLvHTAnalyser(string refFileName, int shortHTLength, int maxError = 5,
			int pruneThreshold = 64);
	twoLvHTAnalyser(string refFileName, int shortHTLength, int midHTLength,
			int longHTLength, int maxError, int pruneThreshold);
	twoLvHTAnalyser(const twoLvHTAnalyser& rhs);
	~twoLvHTAnalyser();
	twoLvHTAnalyser& operator=(const twoLvHTAnalyser& rhs);
	refHash* clone();

	void loadHash(int chrNum);
	void unloadHash();
	vector<unsigned long long> query(string read);
	vector<unsigned long long> query(string read,
			vector<unsigned long int>& conductedAF);
	vector<unsigned long long> testLv(string LongKmer);

	void genStat();
	void printStat();

	//prune the longHT
	void pruneHT();

private:
	int longHTLength;
	int midHTLength;
	int shortHTLength;

	int maxError;
	int pruneThreshold;

	refAnalyser shortHT;
	refAnalyser midHT;
	refAnalyser longHT;

	vector<unsigned long int> conductedAF;
};

#endif /* TWOLVHTANALYSER_H_ */
